#
# import os, time
#
# os.environ['TZ'] = 'Asia/Shanghai'
# time.tzset()
import sys


import logging as log
log.basicConfig(
    level=log.INFO,
    format="[%(asctime)s] %(name)s:%(levelname)s: %(message)s"
)


app = None

def set_app(app_instance):
    global app
    app = app_instance

def get_app():
    global app
    # if app is None:
    #     from flask import Flask
    #     from config import config
    #
    #     app = Flask(__name__)
    #     config_name = "development"
    #
    #     args = sys.argv
    #     print(args)
    #     for arg in args:
    #         if "FLASK_ENV" in arg:
    #             config_name = arg.split("=")[1]
    #
    #     # config_name = "development"
    #     # 根据config_name选定环境变量
    #     app.config.from_object(config[config_name])
    #     config[config_name].init_app(app)

    return app


